<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:p="http://primefaces.org/ui" xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Início</title>
<link rel="StyleSheet" type="text/css" href="css/style.css" />
</h:head>
<body>

<div id="bg">
<div id="cssmenu">
   <span style="position: absolute; left: 0; top: 0; width:100%; height:175px; z-index:-2">
   <img src="imagens/bgmenusemlogo.png" height="175px" width="100%"/></span>
   <span style="position: absolute; left:160"><img src="imagens/logo.png" style="margin-left:-10px; margin-bottom: 50"/></span>
   <br></br><br></br><br></br><br></br><br></br>
   
   <object id="like" type="text/html" data="https://www.facebook.com/plugins/like.php?href=https://www.facebook.com/engajamundo?fref=ts" border="0" align="left" style="border:none; width:400px; padding-left:120px;position:relative;height:60px;"></object>
   
   <div id="listamenu">
   <h:form>
   <!-- opcoes visiveis a todos -->
   <a href = "home.xhtml">Inicio</a>
   <a href = "about.xhtml">Sobre</a>
   <a href = "crowdfunding.xhtml">Patrocine!</a>
   <a href = "video.xhtml">LiveStream</a>
   <a href = "tweets.xhtml">Tweets</a>
   <!-- apenas usuarios e admins -->

	<p:commandLink action="#{controllerEngajador.visualizar}" rendered="#{controllerSession.ehAdmin}">Usuários </p:commandLink>
	<p:commandLink action="#{controllerEngajador.criarPostagem}" rendered="#{controllerSession.estaLogado}">Postagens </p:commandLink>
	<p:commandLink action="#{controllerEngajador.buscas}" rendered="#{controllerSession.estaLogado}">Buscas </p:commandLink>
	<p:commandLink action="#{controllerSession.logoff}" rendered="#{controllerSession.estaLogado}"
					value="Logoff"/>
	
</h:form>
   </div>
</div>


<div id="content">
<div id="guia">
        <b>Bem vindo!</b>
        <p>Informe o nome de usuario e senha nos campos abaixo.</p>
        <b>Se nao for cadastrado,</b> <a href= "singup.xhtml">cadastre-se.</a><p></p>
</div>  
          
<div id="login">

        <h:form id="home">
        
<p:growl id="growl" showSummary="false" showDetail="true" sticky="true" />
        
                <div id="user"> 
                        Login: <p:inputText style="width: 120px;" required="true" id = "login" requiredMessage="Informe o seu login" value="#{controllerSession.login}">
                        <f:validator validatorId="loginCorretoValidator"/>
                        </p:inputText>
        </div>
        
                <div id="password">
                        Senha:<p:password style="width: 120px;" id="password" required="true" requiredMessage="Informe a sua senha" value="#{controllerSession.senha}"></p:password>
                </div>

        <p></p>
                <div id="button-login">
                  <p:commandButton  action="#{controllerSession.autenticar}" value="Entrar!" ajax="false"  update="growl"></p:commandButton>
                </div>          

        </h:form>

</div>
</div>

<div id="footer">
        MIT Licence
</div>

</div>

</body>
</html>